package utils


func stringArray2Map(data []string) (res map[string]struct{}){
	res = make(map[string]struct{})
	for _, v := range data{
		res[v] = struct{}{}
	}
	return
}


//求两个字符串数组的差集(a1有，a2没有的部分)
func DiffStringArray(a1, a2 []string)(res []string){
	res = []string{}
	m2 := stringArray2Map(a2)
	for _, v := range a1{
		if _, exist := m2[v];!exist{
			res = append(res, v)
		}
	}
	return
}